package com.lam.fundamental;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import com.lam.myview.CircleImageButton;

public class TitleFragment extends Fragment  {  
  
    private CircleImageButton mLeftMenu;  
    private OnTitleButtonClickListener mCallBack;

    
    
    public interface OnTitleButtonClickListener{
    	public void OnTitleButtonClick(View v);
    }
    
    
    @Override
	public void onAttach(Activity activity) {
		// TODO Auto-generated method stub
		super.onAttach(activity);
		 try {
			 mCallBack = (OnTitleButtonClickListener) activity;
	        } catch (ClassCastException e) {
	            throw new ClassCastException(activity.toString()
	                    + " must implement OnHeadlineSelectedListener");
	        }
	}

    @Override  
    public View onCreateView(LayoutInflater inflater, ViewGroup container,  
            Bundle savedInstanceState)  
    {  
        View view = inflater.inflate(R.layout.fragment_title, container, false);  
        mLeftMenu = (CircleImageButton) view.findViewById(R.id.id_title_left_btn); 
        
        mLeftMenu.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				mCallBack.OnTitleButtonClick(v);
			}
		});
        return view;
    }


	
}  